//
//  UIView+Loading.m
//  Test
//
//  Created by jingyao on 2017/12/29.
//  Copyright © 2017年 jingyao. All rights reserved.
//

#import "UIView+Loading.h"
#import <MBProgressHUD.h>

@implementation UIView (Loading)

- (void)showLoading {
    [self showLoadingWithMessage:@"加载中"];
}

- (void)showLoadingWithMessage:(NSString *) message {
    MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self animated:YES];
    hud.mode = MBProgressHUDModeIndeterminate;
    hud.label.text = message;
}

- (void)hiddenLoading {
    [MBProgressHUD hideHUDForView:self animated:YES];
}

@end
